#pragma strict
var jackpot:AudioClip;
public var i:textscript;
public var lightcyl:Light;
//public var psys:Component;
//public var psys1:Component;
//public var psys2:Component;
public var flag:boolean=false;
public var t:int=0;

function Start () {
/*
psys.particleEmitter.enabled =false;
psys1.particleEmitter.enabled = false;
psys2.particleEmitter.enabled =false;
*/
}

function Update () {
if(i.score==100)
{
/*
psys.particleEmitter.enabled = true;
psys1.particleEmitter.enabled = true;
psys2.particleEmitter.enabled= true;
*/
}
}

function OnCollisionEnter(other:Collision)
{
audio.PlayClipAtPoint(jackpot,transform.position);
i.AddScore();
Debug.Log(lightcyl.name);
lightcyl.enabled=!lightcyl.enabled;
/*
while(t<=10)
{
t++;
lightcyl.light.intensity=t;
}
*/

}
/*
function OnCollisionExit(other:Collision)
{
while(t>0)
{
t--;
lightcyl.light.intensity=t;
}
}
*/